<?php  include VIEWPATH.'common/head.php';  ?>
    <script type="text/javascript">
        var status = '<?php echo $_GET['status'];?>';
        if(status == '-1'){
            alert('fail:<?php echo $_GET['msg'];?>');
        }
        function setDel(id){
            if(confirm("确定删除该用户吗？")){
                var url = 'index.php?c=user&m=del_write&id='+id;
                var param = {};
                common_ajax(url, param, function (data){
                    if(data.errorCode == 0) {
                        //表单提交
                        window.location.href=  window.location.href;
                        return true;
                    }else{
                        alert(data.errorMsg);
                    }
                });
            }
        }
    </script>

    <body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div class="add-btn" style="float:right;margin-bottom:5px;">
            <div class="modal fade" id="add_write" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
                <div class="modal-dialog" style="width: 60%;"><div class="modal-content"></div></div>
            </div>
        </div>
        <div class="clearfix"></div>
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <a href="index.php?c=user&m=add_write" class="btn btn-danger" data-toggle="modal" data-target="#add_write">添加</a>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <form class="form-horizontal" id="f_form" action="index.php?c=<?php echo $_REQUEST['c'];?>&m=<?php echo $_REQUEST['m'];?>" name="form" method="post">
                            <div class="form-group">
                                <div class="col-sm-1 text-right"><label class="control-label">手机号：</label></div>
                                <div class="col-sm-2">
                                    <input type="text" placeholder="请输入手机号" class="form-control" value="<?php echo $_REQUEST["mobile"];?>" name="mobile" autocomplete="off"/>
                                </div>

                                <div class="col-sm-1">
                                    <button class="btn btn-sm btn-primary" type="submit"> 搜索 </button>
                                </div>
                            </div>

                            <table class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>手机号</th>
                                    <th>操作人昵称</th>
                                    <th>操作人手机号</th>
                                    <th>时间</th>
                                    <th>&nbsp;&nbsp;&nbsp;&nbsp;</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php foreach($userList as $user) { ?>
                                    <tr>
                                        <td><?php echo $user['mobile']; ?></td>
                                        <td><?php echo $user['nickname']; ?></td>
                                        <td><?php echo $user['u_mobile']; ?></td>
                                        <td><?php echo date("Y-m-d H:i", $user['add_time']); ?></td>
                                        <td nowrap="nowrap">
                                            <a href="javascript:void(0)" onclick="setDel(<?php echo $user['id']; ?>)" class="btn btn-white">删除</a>
                                        </td>
                                    </tr>
                                <?php }?>
                                </tbody>
                            </table>
                            <div class="set_page">
                                <?php echo $multipage;?>
                                <div class="clearfix"></div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>

    </div>


<?php  include VIEWPATH.'common/footer.php';  ?>